import Https from '@/utils/https'

// 保存目录
const saveDir = (params) => Https.post('/api/v1/offlineDev/dir/save', params, { json: false })
// 删除节点，支持所有节点类型
const deleteTask = (params) => Https.post('/api/v1/offlineDev/node/delete', params, { json: false })
// 获取目录树
const getDirTree = (params) => Https.get('/api/v1/offlineDev/dir/tree', params)
// 移动节点至其他目录
const devDirChange = (params) => Https.post('/api/v1/offlineDev/dir/change', params, { json: false })
// 保存资源节点
const saveResource = (params) => Https.post('/api/v1/offlineDev/resource/saveResource', params, { json: false })
// 获取资源详情
const getResourceDetail = (params) => Https.get('/api/v1/offlineDev/resource/getResourceDetail', params)
// 获取目录树
const getTrees = (params) => Https.get('/api/v1/offlineDev/node/listAll', params)
// 删除资源
const dropResource = (params) => Https.post('/api/v1/offlineDev/resource/dropResource', params, { json: false })

export {
  saveDir, deleteTask, getDirTree, devDirChange, saveResource, getResourceDetail, getTrees, dropResource,
}
